package com.trippin.Utils;

import java.io.Serializable;
import java.util.Comparator;
import java.util.Date;

import com.trippin.DB.entities.TripEntity.ShortDetailedTrip;

public class ShortDetailedTripListComparator implements Comparator<ShortDetailedTrip>, Serializable {

	private static final long serialVersionUID = 1L;

	@Override
	public int compare(ShortDetailedTrip trip0, ShortDetailedTrip trip1) {

		Date lastModified0 = trip0.getLastModifiedOn();
		Date lastModified1 = trip1.getLastModifiedOn();
		
		if(lastModified0.after(lastModified1)) {
			return -1;
		}
		else {
			return 1;
		}
	}

}
